home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!escan.demon.co.uk
- From: Bill Birrell <bill@escan.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: A weird thing about printf()
- Date: Fri, 12 Apr 1996 10:10:00
- Message-ID: <829297581.AA00180@escan.demon.co.uk>
- Reply-To: bill@escan.demon.co.uk
- X-NNTP-Posting-Host: escan.demon.co.uk
- X-Mail2News-Path: escan.demon.co.uk
-
- > The program :
-
- > #include <stdio.h>
-
- > int answer;
- > main()
- > {
- > answer=2+2;
- > printf("The answer is %d\n");
- > return 0;
- > }
-
- Are you kidding? if you want parameter substitution you have to have
- parameters - the compiler is not expected to read your mind - so you needed to
- have written:-
-
- printf("The answer is %d\n", answer);
-
- --
- Regards,
- Bill Birrell.
- internet: bill@escan.demon.co.uk
-